/**
 * 添加销售渠道交易
 * @author alern2008@gmail.com
 * @系统名称：定制化辅助生成制造系统
 * 
 */

package org.ccams.tran;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.ccams.domain.TFlowstatuscode;

public class Tran13132 extends AbstractJsonTran {

	@SuppressWarnings("unchecked")
	public void buildJSONObject(Map model, JSONObject json,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String fscode = (String) request.getParameter("fscode");
		String fsname = (String) request.getParameter("fsname");
		HashMap<String, Object> jsonMap = new HashMap<String, Object>();
		boolean success = false;
		String message = "";
		TFlowstatuscode t = new TFlowstatuscode();
		t.setFscode(fscode);
		t.setFsname(fsname);
		int i = getCcamsService().getTflowstatuscodeDao().insert(t);
		if (i == 1) {
			success = true;
			message = "流程代码添加成功";
		} else {
			success = false;
			message = "流程代码添加失败";
		}
		jsonMap.put("success", success);
		jsonMap.put("message", message);
		json.putAll(jsonMap);
	}
}
